package com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.jess.arms.base.BaseActivity;
import com.jess.arms.di.component.AppComponent;
import com.jess.arms.utils.ArmsUtils;
import com.xiaoxing.zhinenghuacangku_nanjinglu.R;
import com.xiaoxing.zhinenghuacangku_nanjinglu.R2;
import com.xiaoxing.zhinenghuacangku_nanjinglu.di.component.DaggerNanJingLu_DianBiaoGongNengCaoZuoXuanZeComponent;
import com.xiaoxing.zhinenghuacangku_nanjinglu.di.module.NanJingLu_DianBiaoGongNengCaoZuoXuanZeModule;
import com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.contract.NanJingLu_DianBiaoGongNengCaoZuoXuanZeContract;
import com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.presenter.NanJingLu_DianBiaoGongNengCaoZuoXuanZePresenter;
import com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.entity.NanJingLu_DianBiaoGongNengCaoZuoXuanZe;

import java.util.HashMap;

import butterknife.OnClick;
import com.jess.arms.utils.CProgressDialogUtils;
import me.jessyan.armscomponent.commonres.utils.ToolbarUtils;
import me.jessyan.armscomponent.commonsdk.core.RouterHub;
import me.jessyan.armscomponent.commonsdk.utils.Utils;

import static com.jess.arms.utils.Preconditions.checkNotNull;

/**
 * @ProjectName: 青岛-南京路自动化仓库
 * @ackage: com.xiaoxing.zhinenghuacangku_nanjinglu.mvp.ui.activity
 * @ClassName: NanJingLu_DianBiaoGongNengCaoZuoXuanZeActivity
 * @Description: 电表功能选择页面
 * @Author: 小星
 * @CreateDate: 2020/6/14 0014 16:40
 * @UpdateUser: 更新者：
 * @UpdateDate: 2020/6/14 0014 16:40
 * @UpdateRemark: 更新说明：
 * @Version: 1.0
 */
@Route(path = RouterHub.ZHI_NENG_HUA_CANG_KU_NANJINGLU_ACTIVITY_NAN_JING_LU__DIAN_BIAO_GONG_NENG_CAO_ZUO_XUAN_ZE)
public class NanJingLu_DianBiaoGongNengCaoZuoXuanZeActivity extends BaseActivity<NanJingLu_DianBiaoGongNengCaoZuoXuanZePresenter> implements NanJingLu_DianBiaoGongNengCaoZuoXuanZeContract.View {


    @Override
    public void setupActivityComponent(@NonNull AppComponent appComponent) {
        DaggerNanJingLu_DianBiaoGongNengCaoZuoXuanZeComponent //如找不到该类,请编译一下项目
                .builder()
                .appComponent(appComponent)
                .nanJingLu_DianBiaoGongNengCaoZuoXuanZeModule(new NanJingLu_DianBiaoGongNengCaoZuoXuanZeModule(this))
                .build()
                .inject(this);
    }

    @Override
    public int initView(@Nullable Bundle savedInstanceState) {
        return R.layout.activity_nan_jing_lu__dian_biao_gong_neng_cao_zuo_xuan_ze; //如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
    }

    @Override
    public void initData(@Nullable Bundle savedInstanceState) {

        ToolbarUtils.initToolbarTitleBack(this, getString(R.string.activity_nan_jing_lu__dian_biao_gong_neng_cao_zuo_xuan_ze));
        //getNanJingLu_DianBiaoGongNengCaoZuoXuanZeData();
    }

    /**
     * @param
     * @return
     * @method 电表AGV入库 {@link }
     * @description 电表AGV入库
     * @date: 2020/6/14 0014 16:42
     * @author: 小星
     */
    @OnClick(R2.id.btn_dian_biao_agv_ru_ku)
    public void dianBiaoAGVRuKu() {
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_NANJINGLU_ACTIVITY_NAN_JING_LU__DIAN_BIAO_A_G_V_RU_KU);
    }

    @OnClick(R2.id.btn_dian_biao_li_ku_ru_ku)
    public void dianBiaoLiKuRuKu() {
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_NANJINGLU_ACTIVITY_NAN_JING_LU__DIAN_BIAO_LI_KU_RU_KU);
    }

    @OnClick(R2.id.btn_dian_biao_chu_ku)
    public void dianBiaoChuKu() {
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_NANJINGLU_ACTIVITY_NAN_JING_LU__DIAN_BIAO_CHU_KU);
    }

    @OnClick(R2.id.btn_chu_ku_ren_wu_lie_biao)
    public void dianBiaoChuKuRenWuLieBiao() {
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_NANJINGLU_ACTIVITY_NAN_JING_LU__DIAN_BIAO_CHU_KU_REN_WU_LIE_BIAO);
    }

    @OnClick(R2.id.btn_jian_xiu_chu_ku)
    public void onBtnJianXiuChuKuClicked() {//检修出库
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_NanJingLu_JIAN_XIU_CHU_KU_ACTIVITY);
    }

    @OnClick(R2.id.btn_jian_Xiu_wan_cheng_ru_ku)
    public void onBtnJianXiuWanChengRuKuClicked() {//检修完成入库
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_NANJINGLU_ACTIVITY_JIAN_XIU_RU_KU);
    }

    @OnClick(R2.id.btn_dian_biao_ji_hua_chu_ku)
    public void btnDianBiaoJiHuaChuKu() {//电表计划出库
        Utils.navigation(this, RouterHub.ZHI_NENG_HUA_CANG_KU_NANJINGLU_ACTIVITY_NAN_JING_LU__DIAN_BIAO_JI_HUA_CHU_KU);
    }

    @Override
    public void getNanJingLu_DianBiaoGongNengCaoZuoXuanZeDataSuccess(NanJingLu_DianBiaoGongNengCaoZuoXuanZe entityData) {


    }

    private void getNanJingLu_DianBiaoGongNengCaoZuoXuanZeData() {
        HashMap<String, String> map = new HashMap<>();

        mPresenter.getNanJingLu_DianBiaoGongNengCaoZuoXuanZeData(map);
    }


    @Override
    public void showLoading() {
        CProgressDialogUtils.showProgressDialog(this);
    }

    @Override
    public void hideLoading() {
        CProgressDialogUtils.cancelProgressDialog(this);
    }

    @Override
    public void showMessage(@NonNull String message) {
        checkNotNull(message);
        ArmsUtils.makeText(this, message);
    }

    @Override
    public void launchActivity(@NonNull Intent intent) {
        checkNotNull(intent);
        ArmsUtils.startActivity(intent);
    }

    @Override
    public void killMyself() {
        finish();
    }
}
